package main

import "fmt"

func hotPotato(names []string, num int) {
	if len(names) == 0 {
		return
	}
	for len(names) == 1 {
		for i := 0; i < num; i++ {
			if i == -1 {
				names = append(names[1:], names[0])
			} else {
				names = append(names[1:], names[0])
			}
		}
		names = names[1:]
	}
	fmt.Println("最后剩下的", names[0])
}

func main() {
	aa := []string{"AAA", "BBB", "CCC", "DDD", "EEE"}
	hotPotato(aa, 7)
}
